<?php
use frontendw\assets\AppAsset;
use yii\helpers\Html;
use yii\helpers\Url;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="<?= Yii::$app->charset ?>"/>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="keywords" content="微信刷投票,微信刷关注,加关注,微信刷阅读量,回复粉,微信刷粉丝,扫码关注,公众号刷粉,拉票助力任务群,微信手工投票,微信兼职群,图文点赞,公众平台刷粉丝,刷投票平台代理,微信个人号刷粉,刷粉投票平台"/>
        <meta name="description" content="“微信投票平台旨在为大家提供一个诚实守信的网络兼职平台,为日益增加的网络拉票需要提供支持！" />
        <?= Html::csrfMetaTags() ?>
        <title>皓夜科技-任务派发平台  微信兼职平台</title>
        <script type="text/javascript" src="/js/mui.js"></script>
        <script type="text/javascript" src="/js/mui.picker.min.js"></script>
        <script type="text/javascript" src="/js/jquery-2.1.4.js"></script>
        <script type="text/javascript" src="/js/layer.js"></script>
        <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
        <script type="text/javascript" src="/js/app.js"></script>
        <?php $this->head() ?>
    </head>
    <body>
        <?php $this->beginBody() ?>
        <div class="mui-content">
            <style>
                .mui-input-group {
                    margin-top: 10px;
                }

                .mui-input-group:first-child {
                    margin-top: 20px;
                }

                .mui-input-group label {
                    width: 22%;
                }

                .mui-input-row label~input,
                .mui-input-row label~select,
                .mui-input-row label~textarea {
                    width: 78%;
                }
            </style>
            <div class="login-portrait">
                <img src="/images/login.png" />
            </div>
            <form id='login-form' class="mui-input-group">
                <div class="mui-input-row">
                    <label>账号</label>
                    <input id='account' type="text" name="name" class="mui-input-clear mui-input" placeholder="请输入账号">
                </div>
                <div class="mui-input-row">
                    <label>密码</label>
                    <input id='password' name="password" type="password" class="mui-input-clear mui-input" placeholder="请输入密码">
                </div>
            </form>
            <div class="mui-content-padded">
                <button id='login' class="mui-btn mui-btn-block mui-btn-primary" style="padding:6px 0;">登录</button>
                <div class="link-area"><a id='reg' href="<?php echo Url::toRoute("site/signup"); ?>">注册账号</a> 
                </div>
            </div>
            <script>
                (function ($, doc) {
                    $.init({
                        statusBarBackground: '#f7f7f7'
                    });
                    //检查 "登录状态/锁屏状态" 结束
                    var loginButton = doc.getElementById('login');
                    var accountBox = doc.getElementById('account');
                    var passwordBox = doc.getElementById('password');
                    loginButton.addEventListener('tap', function (event) {
                        var loginInfo = {
                            account: accountBox.value,
                            password: passwordBox.value
                        };
                        app.login(loginInfo, function (err) {
                            if (err) {
                                mui.toast(err);
                                return;
                            }
                            window.location.herf = "/site/index.html";
                        });
                    });
                }(mui, document));
            </script>
        </div>
        <?php $this->endBody() ?>
    </body>
</html>
<?php $this->endPage() ?>

